package com.example.assetmanagement.mapper;

import com.example.assetmanagement.domain.MaintenancePlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MaintenancePlanMapper {
    List<MaintenancePlan> selectPage(@Param("offset") int offset,
                                     @Param("limit") int limit,
                                     @Param("type") String type,
                                     @Param("status") Integer status,
                                     @Param("startDate") String startDate,
                                     @Param("endDate") String endDate);

    long count(@Param("type") String type,
               @Param("status") Integer status,
               @Param("startDate") String startDate,
               @Param("endDate") String endDate);

    int insert(MaintenancePlan plan);

    int update(MaintenancePlan plan);

    int deleteById(@Param("id") Long id);

    int deleteBatch(@Param("ids") List<Long> ids);

    int updateStatus(@Param("id") Long id,
                     @Param("status") Integer status,
                     @Param("progress") Integer progress);
} 